package observer.jdk;

import observer.Observer;

import java.util.Observable;

public class ConcreteSubject  extends Observable {

    public void notifyAllObservers() {
        //必须设置已更改标志，才会通知给所有观察者
        /**
         * protected synchronized void setChanged() {
         *         changed = true;
         *     }
         */
        setChanged();
        notifyObservers();
    }
}
